﻿using Sdg.Domain.BizObj;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sdg.Domain
{
    public interface IView
    {
        void Bind(IBizObj bizObj);
        IBizObj BizObject { get; }
        void SelfRegister();
        void UnRegister();
        bool Focus();
        void Notify(ViewEventArgs args);
        event EventHandler<ViewEventArgs> AfterInit;
        event EventHandler<ViewEventArgs> Done;
    }

    public class ViewEventArgs : EventArgs
    {
        private IView _view = null;
        private object _eventParams = null;
        public bool Handled = false;

        public ViewEventArgs(IView view, object eventParams)
        {
            _view = view;
            _eventParams = eventParams;
        }
        
        public IView View { get { return _view; } }
        public object Params
        {
            get
            {
                return _eventParams;
            }
        }
    }

   
}
